﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EntLib.Base.Algorithm
{
    /// <summary>
    /// 判断一个整数是奇数还是偶数。
    /// </summary>
   public class OddEven
    {
       /// <summary>
       /// 是否是偶数
       /// </summary>
        /// <param name="i">参数</param>
       /// <returns></returns>
       public static bool IsEven(  int i)
       {
           return (i & 1) == 0;
       }
       /// <summary>
       /// 是否是奇数
       /// </summary>
       /// <param name="i">参数</param>
       /// <returns></returns>
       public static bool IsOdd(int i)
       {
           return !IsEven(i);
       }

    }
}
